home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / sun / volume3 / catcher / patch01 < prev    next >
Encoding:
Internet Message Format  |  1991-05-14  |  10.7 KB

  1. Path: uunet!elroy.jpl.nasa.gov!swrinde!mips!dimacs.rutgers.edu!aramis.rutgers.edu!mcgrew
  2. From: mcgrew@aramis.rutgers.edu (Charles Mcgrew)
  3. Newsgroups: comp.sources.sun
  4. Subject: v03i007:  Catcher 1.0 - patches
  5. Message-ID: <May.14.13.31.15.1991.29137@aramis.rutgers.edu>
  6. Date: 14 May 91 17:31:17 GMT
  7. Organization: Rutgers Univ., New Brunswick, N.J.
  8. Lines: 331
  9. Approved: mcgrew@aramis.rutgers.edu
  10.  
  11. Submitted-by: news@trantor.harris-atd.com (News stuff)
  12. Posting-number: Volume 3, Issue 7
  13. Archive-name: catcher/patch01
  14.  
  15.  
  16.      My apologies to those of you who built catcher only to discover that
  17. it wouldn't even work with the samples I packed with it.  I have since
  18. fixed several minor but fatal bugs, and this patch should give you a
  19. much happier tool.
  20.  
  21.      Again, my apologies for such a buggy first release.
  22.      
  23. Chuck Musciano                ARPA  : chuck@trantor.harris-atd.com
  24. Harris Corporation             Usenet: ...!uunet!x102a!trantor!chuck
  25. PO Box 37, MS 3A/1912            AT&T  : (407) 727-6131
  26. Melbourne, FL 32902            FAX   : (407) 729-3363
  27.  
  28. A good newspaper is never good enough,
  29.     but a lousy newspaper is a joy forever.        -- Garrison Keillor
  30.  
  31. #! /bin/sh
  32. # This is a shell archive.  Remove anything before this line, then unpack
  33. # it by saving it into a file and typing "sh file".  To overwrite existing
  34. # files, type "sh file -c".  You can also feed this as standard input via
  35. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  36. # will see the following message at the end:
  37. #        "End of shell archive."
  38. # Contents:  patch
  39. # Wrapped by chuck@melmac on Tue Jan 29 12:41:23 1991
  40. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  41. if test -f 'patch' -a "${1}" != "-c" ; then 
  42.   echo shar: Will not clobber existing file \"'patch'\"
  43. else
  44. echo shar: Extracting \"'patch'\" \(8362 characters\)
  45. sed "s/^X//" >'patch' <<'END_OF_FILE'
  46. X*** Makefile.orig    Tue Jan 29 12:39:44 1991
  47. X--- Makefile    Tue Jan 22 07:32:58 1991
  48. X***************
  49. X*** 43,49 ****
  50. X  install: catcher $(MAN)/catcher.$(MANEXT)
  51. X      cp catcher $(BIN)
  52. X      chmod 755 $(BIN)/catcher
  53. X-     cp catcher.info $(HELPDIR)
  54. X  
  55. X  $(MAN)/catcher.$(MANEXT): catcher.man
  56. X      cp -p catcher.man $(MAN)/catcher.$(MANEXT)
  57. X--- 43,48 ----
  58. X*** Imakefile.orig    Tue Jan 29 12:39:47 1991
  59. X--- Imakefile    Tue Jan 22 07:32:57 1991
  60. X***************
  61. X*** 20,26 ****
  62. X  ComplexProgramTarget(catcher)
  63. X  
  64. X  install:: install.man
  65. X-     $(INSTALL) -c $(INSTMANFLAGS) catcher.info $(HELPDIR)/catcher.info
  66. X  
  67. X  manual:
  68. X      cd doc; make PRINT="$(PRINT)" PRINTER="$(PRINTER)" manual
  69. X--- 20,25 ----
  70. X*** README.orig    Tue Jan 29 12:39:47 1991
  71. X--- README    Tue Jan 29 12:37:00 1991
  72. X***************
  73. X*** 107,109 ****
  74. X--- 107,115 ----
  75. X  *********************************************************************************
  76. X  
  77. X           1.0    16 Jan 91    Original release
  78. X+      
  79. X+          1.0a    29 Jan 91    Patch 1
  80. X+                      Fixed Imakefile
  81. X+                      Corrected bug in parser
  82. X+                      Corrected handling of suffix string
  83. X+                      Renamed ungetc to last_char in lex.c
  84. X*** lex.c.orig    Tue Jan 29 12:39:53 1991
  85. X--- lex.c    Tue Jan 29 12:33:55 1991
  86. X***************
  87. X*** 52,59 ****
  88. X                   {"value",        VALUE},
  89. X                   {"window",       WINDOW_}};
  90. X  
  91. X- 
  92. X- 
  93. X  PRIVATE    struct    {char    first;
  94. X           char    next;
  95. X           int    name;
  96. X--- 52,57 ----
  97. X***************
  98. X*** 73,85 ****
  99. X         curr_file = "stdin";
  100. X         f = stdin;
  101. X         line_count = 1;
  102. X!        ungetc = -1;
  103. X         return(TRUE);
  104. X         }
  105. X      else if (f = fopen(path, "r")) {
  106. X         curr_file = strsave(path);
  107. X         line_count = 1;
  108. X!        ungetc = -1;
  109. X         return(TRUE);
  110. X         }
  111. X      else
  112. X--- 71,83 ----
  113. X         curr_file = "stdin";
  114. X         f = stdin;
  115. X         line_count = 1;
  116. X!        last_char = -1;
  117. X         return(TRUE);
  118. X         }
  119. X      else if (f = fopen(path, "r")) {
  120. X         curr_file = strsave(path);
  121. X         line_count = 1;
  122. X!        last_char = -1;
  123. X         return(TRUE);
  124. X         }
  125. X      else
  126. X***************
  127. X*** 92,99 ****
  128. X  {    register    char    c;
  129. X      static        int    first = TRUE;
  130. X  
  131. X!     if (ungetc != -1)
  132. X!        c = ungetc, ungetc = -1;
  133. X      else if (f == NULL)
  134. X         return(EOF);
  135. X      else {
  136. X--- 90,97 ----
  137. X  {    register    char    c;
  138. X      static        int    first = TRUE;
  139. X  
  140. X!     if (last_char != -1)
  141. X!        c = last_char, last_char = -1;
  142. X      else if (f == NULL)
  143. X         return(EOF);
  144. X      else {
  145. X***************
  146. X*** 182,188 ****
  147. X         *p++ = c;
  148. X         while (isalnum(c = getch()) || c == '_')
  149. X            *p++ = c;
  150. X!        ungetc = c;
  151. X         *p = '\0';
  152. X         temp = strsave(buf);
  153. X         for (p = buf; *p; p++)
  154. X--- 180,186 ----
  155. X         *p++ = c;
  156. X         while (isalnum(c = getch()) || c == '_')
  157. X            *p++ = c;
  158. X!        last_char = c;
  159. X         *p = '\0';
  160. X         temp = strsave(buf);
  161. X         for (p = buf; *p; p++)
  162. X***************
  163. X*** 220,226 ****
  164. X         while (isdigit(c = getch()))
  165. X            *p++ = c;
  166. X         *p = '\0';
  167. X!        ungetc = c;
  168. X         yylval.ival = atoi(buf);
  169. X         RETURN(INTEGER);
  170. X         }
  171. X--- 218,224 ----
  172. X         while (isdigit(c = getch()))
  173. X            *p++ = c;
  174. X         *p = '\0';
  175. X!        last_char = c;
  176. X         yylval.ival = atoi(buf);
  177. X         RETURN(INTEGER);
  178. X         }
  179. X***************
  180. X*** 240,246 ****
  181. X               for (c1 = getch(), j = 1; punc[i + j].first == c; j++)
  182. X                  if (c1 == punc[i + j].next)
  183. X                     RETURN(punc[i + j].name);
  184. X!              ungetc = c1;
  185. X               RETURN(punc[i].name);
  186. X               }
  187. X         yyerror("Invalid character in source file: %c (0x%02x)", c, c);
  188. X--- 238,244 ----
  189. X               for (c1 = getch(), j = 1; punc[i + j].first == c; j++)
  190. X                  if (c1 == punc[i + j].next)
  191. X                     RETURN(punc[i + j].name);
  192. X!              last_char = c1;
  193. X               RETURN(punc[i].name);
  194. X               }
  195. X         yyerror("Invalid character in source file: %c (0x%02x)", c, c);
  196. X*** parse.y.orig    Tue Jan 29 12:39:58 1991
  197. X--- parse.y    Tue Jan 29 12:33:56 1991
  198. X***************
  199. X*** 30,42 ****
  200. X  
  201. X  EXPORT    int    parse_errors_occured;
  202. X  
  203. X! EXPORT    Catch    config = {NULL, NULL, "Catcher", NULL, '$', '{', '}', NULL, NULL};
  204. X  
  205. X  PRIVATE    char    *get_last_token();
  206. X  
  207. X  PRIVATE    char    *curr_file;
  208. X  PRIVATE    int    line_count = 1;
  209. X! PRIVATE    char    ungetc = -1;
  210. X  
  211. X  PRIVATE    Command    *curr_cmd;
  212. X  PRIVATE    Option    *curr_opt;
  213. X--- 30,42 ----
  214. X  
  215. X  EXPORT    int    parse_errors_occured;
  216. X  
  217. X! EXPORT    Catch    config = {NULL, NULL, "Catcher 1.0a", NULL, '$', '{', '}', NULL, NULL};
  218. X  
  219. X  PRIVATE    char    *get_last_token();
  220. X  
  221. X  PRIVATE    char    *curr_file;
  222. X  PRIVATE    int    line_count = 1;
  223. X! PRIVATE    char    last_char = -1;
  224. X  
  225. X  PRIVATE    Command    *curr_cmd;
  226. X  PRIVATE    Option    *curr_opt;
  227. X***************
  228. X*** 59,66 ****
  229. X  
  230. X  %token        LBRACE RBRACE
  231. X  
  232. X! %token        BY CHOICE COMMAND DEFAULT DELIMITER EXCLUSIVE FINISH HORIZONTAL ICON_ ICON_MASK INIT LABEL
  233. X! %token        MESSAGE NONEXCLUSIVE NUMERIC OPTIONAL OUTPUT PARAMETER START SUFFIX TEXT TO VALUE WINDOW_
  234. X  
  235. X  %type    <chval>    anon_choice choice
  236. X  %type    <cpval>    command_name delimiter icon icon_mask label message suffix text_init value
  237. X--- 59,66 ----
  238. X  
  239. X  %token        LBRACE RBRACE
  240. X  
  241. X! %token        BY CHOICE COMMAND DEFAULT DELIMITER EXCLUSIVE HORIZONTAL ICON_ ICON_MASK INIT LABEL
  242. X! %token        MESSAGE NONEXCLUSIVE NUMERIC OPTIONAL OUTPUT PARAMETER SUFFIX TEXT TO VALUE WINDOW_
  243. X  
  244. X  %type    <chval>    anon_choice choice
  245. X  %type    <cpval>    command_name delimiter icon icon_mask label message suffix text_init value
  246. X***************
  247. X*** 383,389 ****
  248. X  
  249. X  {    char    buf1[1024], buf2[1024];
  250. X  
  251. X!     sprintf(buf1, "%s: line %d: ", curr_file, line_count - ((ungetc == '\n')? 1 : 0));
  252. X      sprintf(buf2, s1, s2, s3, s4, s5, s6, s7);
  253. X      strcat(buf1, buf2);
  254. X      if (strcmp(s1, "syntax error") == 0) {
  255. X--- 383,389 ----
  256. X  
  257. X  {    char    buf1[1024], buf2[1024];
  258. X  
  259. X!     sprintf(buf1, "%s: line %d: ", curr_file, line_count - ((last_char == '\n')? 1 : 0));
  260. X      sprintf(buf2, s1, s2, s3, s4, s5, s6, s7);
  261. X      strcat(buf1, buf2);
  262. X      if (strcmp(s1, "syntax error") == 0) {
  263. X*** patchlevel.h.orig    Tue Jan 29 12:40:00 1991
  264. X--- patchlevel.h    Tue Jan 29 12:11:30 1991
  265. X***************
  266. X*** 0 ****
  267. X--- 1,29 ----
  268. X+ /************************************************************************/
  269. X+ /*    Copyright 1987-1991 by Chuck Musciano and Harris Corporation     */
  270. X+ /*                                    */
  271. X+ /*    Full ownership of this software, and all rights pertaining to     */
  272. X+ /*    the for-profit distribution of this software, are retained by     */
  273. X+ /*    Chuck Musciano and Harris Corporation.  You are permitted to     */
  274. X+ /*    use this software without fee.  This software is provided "as     */
  275. X+ /*    is" without express or implied warranty.  You may redistribute     */
  276. X+ /*    this software, provided that this copyright notice is retained,    */
  277. X+ /*    and that the software is not distributed for profit.  If you     */
  278. X+ /*    wish to use this software in a profit-making venture, you must     */
  279. X+ /*    first license this code and its underlying technology from     */
  280. X+ /*    Harris Corporation.                         */
  281. X+ /*                                    */
  282. X+ /*    Bottom line: you can have this software, you can use it, you     */
  283. X+ /*    can give it away.  You just can't sell any or all parts of it     */
  284. X+ /*    without prior permission from Harris Corporation.         */
  285. X+ /************************************************************************/
  286. X+ 
  287. X+ /************************************************************************/
  288. X+ /*                                    */
  289. X+ /*    Patch        Comments                    */
  290. X+ /*      0        Initial release                    */
  291. X+ /*               comp.sources.x: Volume 11, Issues 6-10    */
  292. X+ /*                                    */
  293. X+ /*      1        Bug fixes; see README for details        */
  294. X+ /*               comp.sources.x: Volume 11, Issue ?        */
  295. X+ /*                                    */
  296. X+ /************************************************************************/
  297. X*** process.c.orig    Tue Jan 29 12:40:01 1991
  298. X--- process.c    Tue Jan 29 12:33:57 1991
  299. X***************
  300. X*** 340,350 ****
  301. X  {    char    *path;
  302. X      FILE    *f;
  303. X  
  304. X!     path = (char *) malloc(strlen(config.suffix) + 22);
  305. X      strcpy(path, "/tmp/catcher.XXXXXX");
  306. X      mktemp(path);
  307. X!     strcat(path, ".");
  308. X!     strcat(path, config.suffix);
  309. X      if ((f = fopen(path, "w")) == NULL)
  310. X         error("cannot open %s for writing: %s", path, sys_errlist[errno]);
  311. X      else if (fwrite(data, 1, strlen(data), f) != strlen(data)) {
  312. X--- 340,352 ----
  313. X  {    char    *path;
  314. X      FILE    *f;
  315. X  
  316. X!     path = (char *) malloc((config.suffix? strlen(config.suffix) : 0) + 22);
  317. X      strcpy(path, "/tmp/catcher.XXXXXX");
  318. X      mktemp(path);
  319. X!     if (config.suffix) {
  320. X!        strcat(path, ".");
  321. X!        strcat(path, config.suffix);
  322. X!        }
  323. X      if ((f = fopen(path, "w")) == NULL)
  324. X         error("cannot open %s for writing: %s", path, sys_errlist[errno]);
  325. X      else if (fwrite(data, 1, strlen(data), f) != strlen(data)) {
  326. END_OF_FILE
  327. if test 8362 -ne `wc -c <'patch'`; then
  328.     echo shar: \"'patch'\" unpacked with wrong size!
  329. fi
  330. # end of 'patch'
  331. fi
  332. echo shar: End of shell archive.
  333. exit 0
  334.  
  335. Chuck Musciano                ARPA  : chuck@trantor.harris-atd.com
  336. Harris Corporation             Usenet: ...!uunet!x102a!trantor!chuck
  337. PO Box 37, MS 3A/1912            AT&T  : (407) 727-6131
  338. Melbourne, FL 32902            FAX   : (407) 729-3363
  339.  
  340. A good newspaper is never good enough,
  341.     but a lousy newspaper is a joy forever.        -- Garrison Keillor
  342.